// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "PaperCharacter.h"
#include "Character2D.generated.h"

/**
 * 
 */
UCLASS()
class PT001_API ACharacter2D : public APaperCharacter
{
	GENERATED_BODY()

	
	UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly, Category="A0_Character2D", meta=(allowPrivateAccess=true))
	float CurrentFacingDirection = 1.0f; // 1 表示向右，-1 表示向左

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="A0_Character2D", meta=(allowPrivateAccess=true))
	float DashSpeed = 1000.0f;

	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category="A0_Character2D", meta=(allowPrivateAccess=true))
	float DashTime = 1.0f;
	
	UPROPERTY(EditDefaultsOnly,  BlueprintReadOnly, Category="A0_Character2D", meta=(allowPrivateAccess=true))
	TMap<FName, class UPaperFlipbook*> AnimationMap;

protected:
	virtual void BeginPlay() override;
	
public:
	void FlipSprite(float Horizontal);
	void PlayAnimation(const FName& AnimName);

	void Movement(const FVector& Direction);

	float GetDashTime() const { return DashTime; }
	void DashStart();
	void DashEnd();
};
